const { defineConfig } = require('@vue/cli-service')
const path = require('path');

module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    resolve: {
      alias: {
        'videojs': path.resolve(__dirname, 'node_modules/video.js'),
      },
    }
  },

  devServer: {
    proxy: {
      '/home': {// 匹配所有以 '/api1'开头的请求路径
        target: process.env.VUE_APP_BASE_API,//'http://127.0.0.1:8082/api/',// 代理目标的基础路径
        changeOrigin: true,
        pathRewrite: { '^/home': '' }
      },
      '/socket': {
        target: process.env.VUE_APP_SOCKET_API,//'ws://127.0.0.1:8082/websocket/'
        ws: true
      }
    },
  },

})
